package com.zyh;

import com.zyh.entity.Comment;
import com.zyh.entity.User;
import com.zyh.mapper.CommentMapper;
import com.zyh.mapper.UserMapper;
import com.zyh.service.CommentService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
public class test {
    @Autowired
    CommentMapper mapper;
    @Autowired
    CommentService service;
    @Autowired
    UserMapper userMapper;
    @Test
    public void test(){
        List<Comment> comments = service.selectBySchoolId(1);
        comments.forEach(System.err::println);
    }
    @Test
    public void testUser(){
//        User u = new User(null,"张三","123");
        User user = userMapper.selectByNameAndPassword("张三", "123");
        System.out.println(user);
    }
}
